
<template>
  <div>
    <el-dialog
      title="门店账号列表"
      :visible.sync="visible"
      width="70%"
      :before-close="handleClose"
      :destroy-on-close="true"
    >
      <TableList
        v-if="$props.visible"
        ref="TableList"
        :model-value="searchFormData"
        request-url="system/company/adminList"
        request-method="get"
        :init-params="{ companyId: $props.id }"
        :table-data="tableData"
        :table-column="tableColumn"
        :header-btn-show="false"
        :has-search="false"
        :table-padding="0"
      />

    </el-dialog>
  </div>
</template>

<script>
import request from '@/utils/request'

export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    id: Number
  },
  data() {
    return {
      tableData: [],
      searchFormData: {},
      tableColumn: [
        {
          prop: 'userName',
          label: '登录名称'
        }, {
          prop: 'nickName',
          label: '用户昵称',
          width: 120
        }, {
          prop: 'email',
          label: '邮箱号'
        }, {
          prop: 'password',
          label: '邀请码'
        }
      ]
    }
  },
  watch: {
    visible(val) {
      if (val) {
        // this.getList()
      }
    }
  },
  methods: {
    handleClose() {
      this.$emit('close')
    },
    getList() {
      const { id } = this.$props
      request({ url: 'system/company/adminList', method: 'get', params: { pageNum: 1, pageSize: 1, companyId: id }}).then(res => {
        console.log(res)
      })
    }
  }
}
</script>
